package net.zoneland.knowledge.dao;

import org.apache.ibatis.annotations.*;
import java.util.List;

/**
 * 权限分类数据服务.
 */
@Mapper
public interface DutyPermissionMapper {

    /**
     * 根据职务编码查询权限信息列表(权限信息不为空并且是有效的status为1).
     * @param naviCodeList 职务编码列表.
     * @return 返回有效的并且不为空的权限信息列表.
     */
    @Select({
            "<script>",
            "SELECT ADP.POWER_CATEGORY_NAME ",
            "FROM AITK_DUTY_PERMISSIONS ADP  ",
            "WHERE ADP.STATUS = 1 AND ADP.POWER_CATEGORY_NAME IS NOT NULL ",
            "AND ADP.NAVI_CODE IN ",
            "<foreach collection='naviCodeList' index='index' item='item' open='(' separator=',' close=')'>",
            "#{item}</foreach> ",
            "</script>"
    })
    List<String> getPowerCategoryListByNaviCode(@Param("naviCodeList") final List<String> naviCodeList);
}
